import request from '@/utils/request'

export function getGoods(goodsId) {
	return request({
		url: '/goods',
		method: 'get',
		params: {
			goodsId
		},
	})
}

export function getStyleListByIds(ids) {
	return request({
		url: '/style/getStyleListByIds/'+ids,
		method: 'get'
	})
}

export function getGoodsSpecInfo(goodsId) {
	return request({
		url: '/goods/specInfo',
		method: 'get',
		params: {
			goodsId
		},
	})
}

export function listGoodsSpec(goodsId) {
	return request({
		url: '/goods/spec-list',
		method: 'get',
		params: {
			goodsId
		},
	})
}


export function listGoodsDetail(goodsId) {
	return request({
		url: '/goods/detail',
		method: 'get',
		params: { goodsId },
	})
}

export function listGoodsStock(goodsId) {
	return request({
		url: '/goods/stock',
		method: 'get',
		params: {
			goodsId
		},
	})
}

export function checkCart(specInfos, goodsIds, shopId) {
	return request({
		url: '/goods/checkcart',
		method: 'post',
		data: {
			specInfoList: specInfos,
			goodsIdList: goodsIds,
			shopId: uni.getStorageSync("shop").id
		}
	})
}